// src/floor/floor.controller.ts
import { Controller, Get, Param } from '@nestjs/common';
import { FloorService } from './floor.service';
import { Floor } from './floor.entity';

@Controller('floors')
export class FloorController {
    constructor(private readonly floorService: FloorService) { }

    @Get()
    async getAllFloors(): Promise<Floor[]> {
        return this.floorService.getAllFloors();
    }

    @Get(':id')
    async getFloorById(@Param('id') id: number): Promise<Floor> {
        return this.floorService.getFloorById(id);
    }
}